package org.particlethink.model;

import org.particlethink.handler.ArrayStringTypeHandler;
import tk.mybatis.mapper.annotation.ColumnType;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;
import java.util.Date;
import java.util.List;

@Table(name = "acceptances")
public class Acceptance {//验收
    @Id
    @KeySql(useGeneratedKeys = true)
    private Integer id;
    private Date createdAt;
    @ColumnType(typeHandler = ArrayStringTypeHandler.class)
    private List<String> arriveImages;//* 请拍摄物料进场照片
    @ColumnType(typeHandler = ArrayStringTypeHandler.class)
    private List<String> images;//图片
    private String carNumber;//车牌
    private Integer creatorId;//验收人
    private String suggestion;//处理意见
    private Integer deliverId;

//    @ColumnType(typeHandler = ArrayAcceptanceGoodsInfoTypeHandler.class)
//    private List<AcceptanceGoodsInfo> goodsInfo;

    public Acceptance(List<String> images, List<String>  arriveImages, String carNumber, Integer creatorId, String suggestion) {
        this.images = images;
        this.carNumber = carNumber;
        this.creatorId = creatorId;
        this.suggestion = suggestion;
        this.arriveImages = arriveImages;
        this.createdAt = new Date();
    }

    public Acceptance() {
    }

    public Integer getDeliverId() {
        return deliverId;
    }

    public void setDeliverId(Integer deliverId) {
        this.deliverId = deliverId;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() {
        return createdAt;
    }


    public void setCarNumber(String carNumber) {
        this.carNumber = carNumber;
    }

    public String getCarNumber() {
        return carNumber;
    }

    public void setCreatorId(Integer creatorId) {
        this.creatorId = creatorId;
    }

    public Integer getCreatorId() {
        return creatorId;
    }

    public void setSuggestion(String suggestion) {
        this.suggestion = suggestion;
    }

    public String getSuggestion() {
        return suggestion;
    }

//    public List<AcceptanceGoodsInfo> getGoodsInfo() {
//        return new ArrayList<>();
//    }

    public List<String> getImages() {
        return images;
    }

    public void setImages(List<String> images) {
        this.images = images;
    }

    public List<String> getArriveImages() {
        return arriveImages;
    }

    public void setArriveImages(List<String> arriveImages) {
        this.arriveImages = arriveImages;
    }


//    public static class AcceptanceGoodsInfo {
//        private Integer goodsId;
//        private Integer acceptNum;
//        private String comment;
//
//        public Integer getGoodsId() {
//            return goodsId;
//        }
//
//        public void setGoodsId(Integer goodsId) {
//            this.goodsId = goodsId;
//        }
//
//        public Integer getAcceptNum() {
//            return acceptNum;
//        }
//
//        public void setAcceptNum(Integer acceptNum) {
//            this.acceptNum = acceptNum;
//        }
//
//        public String getComment() {
//            return comment;
//        }
//
//        public void setComment(String comment) {
//            this.comment = comment;
//        }
//    }

}
